﻿<el-drawer :title="isAdd?'添加Api资源':'编辑Api资源'" :visible.sync="showDrawer"
           direction="rtl"
           :before-close="handleClose"
           @@opened="handleOpened"
           size="50%">
    <div class="hx-4 hx-flex hx-flex-column hx-h-100">
        <el-form :model="form" ref="ruleForm" :rules="rules" status-icon
                 label-width="90px" class="hx-flex-fill">
            <el-form-item label="资源名称" prop="name">
                <el-input v-model="form.name" :disabled="!isAdd"></el-input>
            </el-form-item>
            <el-form-item label="显示名称" prop="displayName">
                <el-input v-model="form.displayName"></el-input>
            </el-form-item>
            <el-form-item label="描述" prop="description">
                <el-input v-model="form.description"></el-input>
            </el-form-item>
            <el-form-item label="声明" prop="userClaims">
                <el-input v-model="form.userClaims" :autosize="{ minRows: 2, maxRows: 4}"></el-input>
            </el-form-item>
            <el-form-item label="是否启用" prop="enabled">
                <el-switch v-model="form.enabled"></el-switch>
            </el-form-item>
        </el-form>
        <div class="hx-flex">
            <el-button class="hx-flex-fill" @@click="showDrawer = false">取 消</el-button>
            <el-button class="hx-flex-fill" type="primary" @@click="handleSubmit('ruleForm')" :loading="loading">{{ loading ? '提交中 ...' : '提 交' }}</el-button>
        </div>
    </div>
</el-drawer>

